import com.troyworks.validators.Validator;
import util.StringUtil;

/**
 * Validates US phone numbers
 * e.g ###-###-#### (usa)
 * 
 * @author Troy Gardner
 */
class com.troyworks.validators.PhoneValidator extends Validator {
	
	
	public function doValidate(str:String) :Boolean{
		var fi:String = StringUtil.filter(str, StringUtil.NUMBERS);
		//returns only numbers, no spaces or -
		if (fi.length != 10) {
			 return false;
		 }
		return true;
	}
}